<div class="box box-primary">
    <div class="">
        <br/>

        <div class="box box-solid">
            <div class="box-body">
                <?php echo form_open(admin_url('manageAds/index'), 'method="get" class=""'); ?>
                <div class="row">
                    <div class="col-md-10">

                        <div class="row">
                            <?php $row_ = 'col-xs-12 col-sm-6 col-md-2'; ?>
                            <div class="<?php echo $row_; ?>">
                                <div class="form-group">
                                    <label for="ad_name">关键词</label>
                                    <input id="ad_name" type="text" class="form-control input-sm"
                                           value="<?php echo($this->input->get('ad_name')); ?>"
                                           name="ad_name"></div>
                            </div>
                        </div>

                    </div>
                    <div class="col-md-2">
                        <div class="pull-right">
                            <button type="submit" class="btn btn-primary btn-sm">
                                搜索
                            </button>
                            <a href="<?php echo admin_url('manageAds'); ?>"
                               class="btn btn-info btn-sm">取消</a>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>

                <?php echo form_close(); ?>
            </div>
        </div>
    </div>
    <?php if ($ads_list) { ?>

        <div class="box-body">
            <div>
                <div class="pull-left">
                    <a class="btn btn-primary" href="<?php echo admin_url('manageAds/add/') ?>">添加广告</a>
                </div>
                <div class="pull-right ul_no_m">
                    <?php echo $pagination; ?>
                </div>
            </div>
            <div class="clearfix"></div>
            <br/>

            <div class="table-responsive">
                <table class="table table-bordered">
                    <tbody>
                    <tr>
                        <th style="width: 10px">#</th>
                        <th>广告标题</th>
                        <th>PHP代码调用</th>
                        <th style="width: 140px"></th>
                    </tr>
                    <?php foreach ($ads_list as $ads) { ?>
                        <tr>
                            <td><?php echo $ads->ad_seq_id; ?></td>
                            <td><?php echo $ads->ad_name; ?></td>
                            <td><code><?php echo htmlentities('<?php echo $this->language->get_ad('.$ads->ad_seq_id.'); ?>') ?></code></td>
                            <td>
                                <a class="btn btn-xs btn-info"
                                   href="<?php echo admin_url('manageAds/edit/' . $ads->ad_seq_id . '/' . $offset); ?>"><span
                                        class="glyphicon glyphicon-edit"></span> 编辑</a>
                                <a class="btn btn-xs btn-danger"
                                   onclick="return confirm('Are you sure you want to Delete \'<?php echo $ads->ad_name; ?>\'? this will also delete its subcategories')"
                                   href="<?php echo admin_url('manageAds/delete/' . $ads->ad_seq_id . '/' . $offset); ?>"><span
                                        class="glyphicon glyphicon-remove"></span> 删除</a>
                            </td>
                        </tr>
                    <?php } ?>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="box-footer clearfix">
            <div>
                <div class="pull-left">
                    <a class="btn btn-primary" href="<?php echo admin_url('manageAds/add/') ?>">添加广告</a>
                </div>
                <div class="pull-right ul_no_m">
                    <?php echo $pagination; ?>
                </div>
            </div>
        </div>
    <?php } else { ?>
        <div class="callout callout-warning">
            <h4>广告列表是空的！</h4>

            <p>广告列表是空的。你可以
点击 <a href="<?php echo admin_url('manageAds/add'); ?>">这里</a>添加广告.</p>
        </div>
    <?php } ?>
</div>

